package io;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;

public class TestNote {
    public static void main(String[] args) throws IOException {
        Scanner scan=new Scanner(System.in);
        File file=new File("note.txt");
        FileOutputStream fos=new FileOutputStream(file,true);
        System.out.println("请输入...");
        while (true){
            String str=scan.next();
           if ("exit".equals(str)){
               break;
           }else {
            fos.write(str.getBytes(StandardCharsets.UTF_8));
           }
        }
        System.out.println("结束了！");
    }
}
